import { MyContext } from './ContextReducer'
import { useContext } from 'react'

export default function TestUseReducer() {
  const { dispatch, state } = useContext(MyContext)
  return (<p
    style={{ background: state.background, color: state.foreground }}
    onClick={() => dispatch({ type: 'changeColorAndAppName' })}
  >
    this is {state.appName}
  </p>)
}